module.exports = function($scope, $modal, $resource, toaster){

	
    $scope.bigCurrentPage = 1;      //当前页码
	$scope.itemsPerPage = 10;       //每页显示几条

	$scope.countNum = function(){
		$resource('/api/as/puc/subsidycount/getCountForBank', {}, {}).save({'bank': '1'}, function(res){
            if(res.errcode === 0){
				$scope.count = res.data;
            } else {
                toaster.error({title: '', body: '统计失败'});
            }
        });
	}
	$scope.countNum();
    
    $scope.load = function(pageNo){
        var para = {
            'pageNo': pageNo, 
			'pageSize': $scope.itemsPerPage
        };
        $resource('/api/as/puc/subsidycount/getBankCountList', {}, {}).save(para, function(res){
            if(res.errcode === 0){
				$scope.list = res.data.results;
				$scope.totalItems = res.data.totalRecord;
				$scope.bigCurrentPage = pageNo;
            } else {
                toaster.error({title: '', body: res.errmsg});
            }
        });
	};
	$scope.load(1);

    $scope.gogo = function(obj){
		var modalInstance = $modal.open({
			template: require('../views/subsidyrecord.html'),
			controller: 'subsidyrecord',
			size: 'lg',
			resolve: {
				obj: function () {
					return obj;
				}
			}
		});
		modalInstance.result.then(function(result){

		});
	};


};